#2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
#
#What is the smallest number that is evenly divisible by all of the numbers from 1 to 20?

#R:

#def divide(number):
#    for i in xrange(1, 20+1):
#        if not (number % i == 0):
#            print number, i
#            return False
#    return True
#
#number = 232792560
#
#while True:
#    if divide(number):
#        break
#    number += 2
#
#print number

def least_common_multiple(nums):
    """Return least common multiples of nums"""
    return reduce(lambda a, b: a * b / greatest_common_divisor(a, b), nums)

def greatest_common_divisor(a, b):
    """Return greatest common divisor of nums"""
    if b:
        return greatest_common_divisor(b, a % b)
    return a

def euler5():
    return least_common_multiple(xrange(1, 20+1))


print euler5()
